package com.wash.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wash.dao.GoodsMapper;
import com.wash.model.Goods;


@Service
@Transactional
public class GoodsService {

	@Autowired
	private GoodsMapper goodsMapper;
	
	public List<Goods> getGoods(Goods goods){
		List<Goods> lst=goodsMapper.list(goods);
		return lst;
	}
	
	public String addGoods(Goods entity){
		goodsMapper.addEntity(entity);
		return "0";
	}
	
	public String editGoods(Goods entity){
		goodsMapper.editEntity(entity);
		return "0";
	}
	
	public String deleGoods(int id){
		goodsMapper.deleEntity(id);
		return "0";
	}
	
	public Goods getEntity(int id){
		return goodsMapper.getEntity(id);
	}
}
